//关联会议
axios.get("/conference/viewsets/")
.then(res=>res.data.results)
.then(conference=>conference.map(i=>{
  return {
    "label":i.title,
    "value":i.id
  }
}))
.then(conference=>state.关联会议Options= conference)

watch(()=>state.formData.关联会议, (newVal, oldVal) => {
  //由会议标题确定会议类型
  console.log(newVal);
axios
.get("/conference/api/type",{params:{id:newVal}})
.then(res => res.data.results)
.then(conference=>conference.map(i=>{
    return {
      "label":i.type,
      "value":i.type
    }
  }))
.then(conference=>state.formData.会议类型=conference[0].label)

//会议确定后确定时间
axios
.get("/conference/api/preset_time",{params:{id:newVal}})
.then(res => res.data.results)
.then(conference=>conference.map(i=>{
    return {
      "label":i.preset_time,
      "value":i.preset_time
    }
  }))
.then(conference=>state.formData.会议召开时间=conference[0].value)

});

//参会
axios.get("/person/viewsets/")
.then(res=>res.data.results)
.then(person=>person.map(i=>{
  return {
    "label":i.name,
    "value":i.id
  }
}))
.then(person=>state.参会Options= person)

//请假
axios.get("/person/viewsets/")
.then(res=>res.data.results)
.then(person=>person.map(i=>{
  return {
    "label":i.name,
    "value":i.id
  }
}))
.then(person=>state.请假Options= person)
//邀请
axios.get("/person/viewsets/")
.then(res=>res.data.results)
.then(person=>person.map(i=>{
  return {
    "label":i.name,
    "value":i.id
  }
}))
.then(person=>state.邀请Options= person)
//发布单位
axios.get("/danwei/viewsets/")
.then(res=>res.data.results)
.then(danwei=>danwei.map(i=>{
  return {
    "label":i.name,
    "value":i.id
  }
}))
.then(danwei=>state.发布单位Options= danwei)
//印发单位
axios.get("/danwei/viewsets/")
.then(res=>res.data.results)
.then(danwei=>danwei.map(i=>{
  return {
    "label":i.name,
    "value":i.id
  }
}))
.then(danwei=>state.印发单位Options= danwei)
//分送单位
axios.get("/danwei/viewsets/")
.then(res=>res.data.results)
.then(danwei=>danwei.map(i=>{
  return {
    "label":i.name,
    "value":i.id
  }
}))
.then(danwei=>state.分送单位Options= danwei)
